<template>
  <el-container class="bg-white rounded pug-imgbox">
    <el-header class="pug-imgbox-header">
      <el-button type="primary" @click="handlerAdd">新增图标分类</el-button>
      <el-button type="warning" style="margin-left:5px;" @click="handlerUpload">文件上传</el-button>
    </el-header>
    <el-container>
      <pug-image-aside @change="handleActiveById" ref="asideRef"></pug-image-aside>
      <pug-image-main ref="mainRef"></pug-image-main>
    </el-container>
  </el-container>
</template>

<style scoped>
.pug-imgbox {
  height: calc(100vh - 126px)
}

.pug-imgbox-header {
  border-bottom: 1px solid #eee;
  @apply flex items-center;
}
</style>



<script setup>
import { ref } from 'vue';
const src = 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg'
const srcList = [
  'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
  'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
  'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
  'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
  'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg',
  'https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg',
  'https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg',
]


var asideRef = ref(null);
var mainRef = ref(null);

/*打开抽屉*/
const handlerAdd = () => {
  asideRef.value.handlerOpen()
}


const handleActiveById = (id) => {
  mainRef.value.selectData(id);
}

const handlerUpload = ()=>{
  mainRef.value.openUploadDrawer();
}

</script>